#! /usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) JoinQuant Development Team
# Author: Huayong Kuang <kuanghuayong@joinquant.com>

import os
import signal


def handler(signum, frame):
    print 'Signal handler called with signal', signum


# Set the signal handler and a 5-second alarm
signal.signal(signal.SIGTERM, handler)
print "pid:", os.getpid()


_sum = 0
for num in xrange(1, 1000000000):
    _sum += num


print "Sum:", _sum
